import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    item: {},
    staff: {},
    time: null,
    starttime:null,
    endtime:null
  },
  mutations: {
    selectItem(state, item) {
      state.item = item
    },
    selectStaff(state, staff) {
      state.staff = staff
    },
    selectTime(state, time) {
      if(time>new Date()) state.time = time
    },
    openEndTime(state, homeInfo){
      state.starttime = homeInfo.starttime
      state.endtime = homeInfo.endtime
    }
  }
})